fix(cli): sync terminal cursor with input caret for CJK IME - #1142
fix(cli): sync terminal cursor with input caret for CJK IME#1142ddddajie wants to merge 2 commits into
Conversation
|
Good instinct and unusually thorough test coverage (unit tests for Concerns before this is portable as-is:
Recommend keeping the calculation logic ( |
|
Addressed the follow-up feedback in the latest push:
No additional scope was added beyond the existing two files. |
Summary
Fixes #1128.
The CLI rendered a visual caret but did not move the real terminal hardware cursor to the input position. CJK IMEs use the terminal cursor position to anchor their composition and candidate windows, which caused the popup to appear at unrelated screen locations.
This change:
MultilineInputcaretstring-widthtextBufferView.lineInfoaccess behind a guarded adapter while preserving wrapped-line semanticsline-info-changesubscription stable instead of re-subscribing on ordinary caret/value changesTests
Added regression coverage for:
Validation:
bun test cli/src/components/__tests__/multiline-input.test.tsx— 81 passed--rerun-each 3) — 243 passedgit diff --check— passedCLI typecheck is currently blocked by pre-existing missing
tarandreact-dom/servertypings; no errors were reported in the changed files.Manual verification
Manually verified in Windows Terminal with Microsoft Pinyin. Candidate-window positioning followed the input caret correctly across normal CJK input, cursor movement, wrapped lines, and scrolling.